<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 * 
 * 创建时间：2021-11-06 09:25
 *
 * 项目：rm  -  $  - index.php
 *
 * 作者：liwei 
 */

use modules\levfm\table\LevfmForms;
use modules\levfm\widgets\inputs\inputsFormWidget;

?>



<div class="page <?=\lev\base\Controllerv::$pageName?>" data-page="<?=\lev\base\Controllerv::$pageName?>">

    <?php Lev::toolbar()?>

    <div class="navbar navbar-bgcolor-red">
        <div class="navbar-inner">
            <div class="left">
                <a class="link icon-only" href="<?php echo \lev\helpers\UrlHelper::toModule('levfm')?>">
                    <img src="<?php echo Lev::getAlias('@assets/logo.jpg')?>">
                </a>
            </div>
            <div class="center"><?php echo $formInfo['name']?></div>
            <div class="right">
                <?php if (LevfmForms::isVoteForm($formInfo['settings'])):?>
                    <a class="button-fill color-black button scale8" href="<?=\modules\levfm\helpers\UrlfmHelper::forms(0, $formid ?: reset($lists['lists'])['formid'])?>">
                        <svg class="icon" aria-hidden="true"><use xlink:href="#fa-zst"></use></svg>
                        投票
                    </a>
                <?php else:?>
                <a class="button-fill color-black button scale8" href="<?=\modules\levfm\helpers\UrlfmHelper::forms(0, $formid ?: reset($lists['lists'])['formid'])?>">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-compose"></use></svg>
                    发布信息
                </a>
                <?php endif;?>
                <a class="button-fill color-yellow button scale8 transl" href="<?=Lev::toCurrent(['uid'=>Lev::$app['uid']])?>">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-user"></use></svg>
                    我的
                </a>
            </div>
        </div>
    </div>


    <div class="page-content appbg">
        <div class="page-content-inner" style="background: #fff6e5;padding-top:1px">
            <div class="card data-xtable type-search-box">
                <table>
                    <?php if (!empty($typeSearchs)) foreach ($typeSearchs as $v):?>
                    <?php $_input = is_array($v) ? $v : $inputs[$v]; $keyId = $_input['id'];?>
                        <?php if ($options = isset($v['options']) ? $v['options'] : inputsFormWidget::getSelectItem($_input)):?>
                            <tr>
                                <td class="numeric-cell srh-tdv">
                                    <div class="search-inputkey"><?=$_input['title']?></div>
                                </td>
                                <td><div class="flex-box">
                                        <a class="button scale8 color-gray" href="<?php echo Lev::toCurrent([$keyId=>null,'page'=>null]+$srhTypes)?>">全部</a>
                                        <?php foreach ($options as $k => $name): $ckd = isset($srhTypes[$keyId]) && $srhTypes[$keyId] ==$k ? 'button-fill' : ''?>
                                            <a class="button scale8 color-black <?php echo $ckd?>" href="<?php echo Lev::toCurrent([$keyId=>$k, 'srhkey'=>null,'page'=>null]+$srhTypes)?>"><?php echo $name?></a>
                                        <?php endforeach;?>
                                    </div>
                                </td>
                            </tr>
                        <?php endif; endforeach;?>
                    <tr>
                        <td class="numeric-cell srh-tdv">关键词搜索</td>
                        <td>
                            <div class="flex-box" style="align-items: center;flex-wrap: nowrap">
                                <a class="button scale8 wdmin color-gray" href="<?=\modules\levfm\helpers\UrlfmHelper::lists($formid)?>">全部</a>
                            <div class="searchbar" style="margin: 5px;border-radius: 5px;">
                                <div class="searchbar-input">
                                    <input type="search" class="srhkeyInput" placeholder="回车执行搜索" value="<?php echo $srhkey?>">
                                    <a class="searchbar-clear"></a>
                                </div>
                            </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="form-data-list list-block" style="margin: 0">
                <ul>
                <?php foreach ($lists['lists'] as $v):?>
                    <li class="item-content item-link">
                        <div class="item-media icon-img">
                            <a href="<?=Lev::toCurrent(['uid'=>$v['uid']])?>" title="只看TA">
                            <img class="lazy" data-src="<?=\lev\helpers\UserHelper::avatar($v['uid'])?>">
                            </a>
                        </div>
                        <a class="item-inner" href="<?=\modules\levfm\helpers\UrlfmHelper::views($v['id'])?>">
                            <div class="item-title font14">
                                <?=$formInfo['_listSet']['titlePre'],
                                \modules\levfm\table\LevfmDatasChild::setSrhkey($v['srhkey'], ''),
                                $formInfo['_listSet']['titleSuf']
                                ?>
                            </div>
                            <div class="item-after date transr"><?=Lev::asRealTime($v['uptime'])?></div>
                        </a>
                    </li>
                <?php endforeach;?>
                </ul>
                <div class="card-footer">
                    <div class="pages-pbox">
                        <?=$lists['pages']?>
                    </div>
                </div>
            </div>

        </div>

        <div class="card buttons-row borad" style="max-width: 1000px;margin: 10px auto;width: calc(100% - 20px)">
            <?php if (LevfmForms::isVoteForm($formInfo['settings'])):?>
                <a class="button-fill color-black button" href="<?=\modules\levfm\helpers\UrlfmHelper::forms(0, $formid ?: reset($lists['lists'])['formid'])?>">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-zst"></use></svg>
                    投票
                </a>
            <?php else:?>
                <a class="button-fill color-black button" href="<?=\modules\levfm\helpers\UrlfmHelper::forms(0, $formid ?: reset($lists['lists'])['formid'])?>">
                    <svg class="icon" aria-hidden="true"><use xlink:href="#fa-compose"></use></svg>
                    发布信息
                </a>
            <?php endif;?>
            <a class="button-fill color-yellow button" href="<?=Lev::toCurrent(['uid'=>Lev::$app['uid']])?>">
                <svg class="icon" aria-hidden="true"><use xlink:href="#fa-user"></use></svg>
                我的
            </a>
        </div>

        <?php Lev::footer()?>
    </div>


    <div class="LoadPageAjaxJS">
        <script>
        </script>
    </div>
</div>


